#ifndef UDPFILERSERVER_H
#define UDPFILERSERVER_H

#include <QWidget>
#include <QUdpSocket>
#include <QThread>
#include <QFile>
#include <QDir>
#include <QTimer>
#include <QMutex>
#include <QHostInfo>

namespace Ui {
class UdpFilerServer;
}

class UdpFilerServer : public QWidget
{
    Q_OBJECT

public:
    explicit UdpFilerServer(QWidget *parent = nullptr);
    ~UdpFilerServer();
    void Init();
    void startProcess();
private slots:
    void readSocket();
private:
    Ui::UdpFilerServer *ui;
    QUdpSocket* m_pServer;
    qint64 m_totalBytes;
    qint64 m_bytesReceived;
    qint64 m_fileNameSize;
    QString m_fileName;
    QFile *m_localFile;
    QByteArray m_inBlock;
};

#endif // UDPFILERSERVER_H
